
{include file="public/meta" /}
    

</head>

<body class="gray-bg">
<div class="wrapper wrapper-content">
    <div class="row">
        <div class="col-sm-12">
            <div class="ibox float-e-margins">
                <div class="ibox-title">
                    <h5>数据删除</h5>
                    <div class="ibox-tools">
                        <a class="link">
                            <b>
                                <i class="layui-icon layui-icon-refresh"></i>
                            </b>
                        </a>
                    </div>
                </div>
                <div class="ibox-content">
                    <h2 style="color: red">数据诚可贵！恢复价更高！请仔细核实后删除数据！</h2>
                    <!--form元素开始-->
                    <div class="m-t ibox-content layui-form">
                        <div class="layui-form-item">
                            <label class="layui-form-label">学年</label>
                            <div class="layui-input-block">
                                <select name="stu_year" lay-search="">
                                    {volist name="stu_year" id="vo"}
                                        <option value="{$vo.name}">{$vo.name}</option>
                                    {/volist}
                                </select>
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <div class="layui-input-block">
                                <button type="submit" class="layui-btn layui-btn-danger" lay-submit="" lay-filter="component-form-element"><i class="layui-icon">&#xe640;</i>  删除</button>
                            </div>
                        </div>
                    </div>
                    <!--form元素结束-->
                </div>
            </div>
        </div>
    </div>
</div>
<script>
    //Demo
    layui.use('form', function(){
        var form = layui.form;
        //监听提交
        form.on('submit(component-form-element)', function (data) {
            //$('.layui-btn').addClass('layui-disabled').attr('disabled','disabled');
            layer.confirm('您确定删除吗?一旦删除数据将不可恢复！', {icon: 3, title:'提示'}, function(index){
                var load = layer.load();
                $.ajax({
                    url:"{:url('admin/data/data_del')}",
                    type:'post',
                    dataType:'json',
                    data:data.field,
                    success:function(res){
                        if (res.data == 1) {
                            layer.close(load);
                            layer.alert(res.message, {icon: 1});
                        } else if (res.data == 0) {
                            layer.close(load);
                            layer.alert(res.message, {icon: 5});
                        } else {
                            layer.close(load);
                            layer.alert('出现未知错误，如果问题一直出现，您可以联系管理员', {icon: 5});
                        }
                    },error:function () {
                        layer.close(load);
                        layer.open({
                            title: '添加失败'
                            ,content: '当前网络环境不安全，拒绝登录，请调整网络环境'
                        });
                    }
                })
                layer.close(index);
            });
        });
    });
</script>
    <!-- 全局js -->
    {include file="public/footer" /}
</body>

</html>
